﻿using System;
using System.Collections.Generic;
using System.Text;
using Emoney.DataAccess;

namespace pay.DAL
{

    /// <summary>
    /// etone数据库连接字符
    /// </summary>
    public class DBConn
    {
        public static string Con_Etone
        {
            get
            {
#if DEBUG
                return System.Configuration.ConfigurationManager.ConnectionStrings["tempemweb_new"].ConnectionString;
#else 
            byte[] dataToDecrypt = Convert.FromBase64String(System.Configuration.ConfigurationManager.ConnectionStrings["emweb_new"].ConnectionString);

           Emoney.Encrypt.DataProtector dp = new Emoney.Encrypt.DataProtector(Emoney.Encrypt.DataProtector.Store.USE_MACHINE_STORE);

           return System.Text.Encoding.ASCII.GetString(dp.Decrypt(dataToDecrypt, null));
#endif
            }
        }

        public static string Con_emweb_new
        {
            get
            {
                return System.Configuration.ConfigurationManager.ConnectionStrings["tempemweb_new"].ConnectionString;
            }
        }

        public static string Temporary
        {
            get
            {
                return System.Configuration.ConfigurationManager.ConnectionStrings["Temporary"].ConnectionString;
            }
        }
        
    }
}
